home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
T-TPUG Old Monthly Disks
/
(c)tv.d64
/
supermon inst.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
6KB
|
183 lines
10 REM SUPERMON INSTR
20 REM FIXED TO RUN PROPERLY BY
30 REM RICHARD BRADLEY
40 REM TORONTO PET USERS GROUP
50 REM COMMODORE 64 LIBRARIAN
1100 PRINT"[147]"
1200 PRINT" SIMPLE ASSEMBLER "
1300 PRINT".A[146] 2000[146] LDA[146] #$12
1310 [153]".A 2002 STAWAIT $8000,X
1320 PRINT".A 2005 (RETURN)
1330 [153]".
1340 PRINT" IN THE ABOVE EXAMPLE THE USER
1350 [153]"STARTED ASSEMBLY AT 1000 HEX. THE
1360 PRINT"FIRST INSTRUCTION WAS LOAD A REGISTER
1370 [153]"WITH IMMEDIATE 12 HEX. IN THE SECOND
1380 PRINT"LINE THE USER DID NOT NEED TO TYPE THE
1390 [153]"A AND ADDRESS. THE SIMPLE ASSEMBLER
1400 PRINT"PROMPTS WITH THE NEXT ADDRESS. TO EXIT
1410 [153]"THE ASSEMBLER TYPE A RETURN AFTER THE
1420 PRINT"THE ADDRESS PROMPT. SYNTAX IS THE SAME
1430 [153]"AS THE DISASSEMBLER OUTPUT.
1450 GOSUB9000
1500 PRINT" DISASSEMBLER "
1510 PRINT".D[146] 2000[146]
1520 [153]"(SCREEN CLEARS)
1530 PRINT"., 2000 A9 12 LDA #$12
1540 [153]"., 2002 9D 00 80 STA $8000,X
1550 PRINT"., 2005 AA TAX
1560 [153]"., 2006 AA TAX
1570 PRINT"(FULL PAGE OF INSTRUCTIONS)
1600 [153]" DISASSEMBLES 22 INSTRUCTIONS
1610 PRINT"STARTING AT 1000 HEX. THE THREE BYTES
1620 [153]"FOLLOWING THE ADDRESS MAY BE MODIFIED.
1630 PRINT"USE THE CRSR KEYS TO MOVE TO AND MODIFY
1640 [153]"THE BYTES. HIT RETURN AND THE BYTES
1650 PRINT"IN MEMORY WILL BE CHANGED. SUPERMON[146]
1660 [153]"WILL THEN DISASSEMBLE THAT PAGE AGAIN.
1690 GOSUB9000
1700 PRINT" PRINTING DISASSEMBLER "
1710 PRINT".P[146] 2000,2040[146]
1720 [153]"2000 A9 12 LDA #$12
1730 PRINT"2002 9D 00 80 STA $8000,XY.
1740 [153]"2005 AA TAX
1750 PRINT" ...."
1760 PRINT"203F A2 00 LDX #$00
1770 [153]"TO ENGAGE PRINTER, SET UP BEFOREHAND:
1775 PRINT" OPEN 4,4:CMD4
1780 [153]"ON 4.0, ACCESS THE MONITOR VIA A CALL
1785 PRINT"SYS 54386 (*NOT* A BREAK) COMMAND
1790 [141] 9000
1800 [153]" SINGLE STEP "
1810 [153]".I
1820 PRINT" ALLOWS A MACHINE LANGUAGE PROGRAM
1830 [153]"TO BE RUN STEP BY STEP.
1840 PRINT"CALL REGISTER DISPLAY WITH .R[146] AND SET
1850 [153]"THE PC ADDRESS TO THE DESIRED FIRST
1860 PRINT"INSTRUCTION FOR SINGLE STEPPING.
1870 [153]"THE .IWAIT WILL CAUSE A SINGLE STEP TO
1880 PRINT"EXECUTE AND WILL DISASSEMBLE THE NEXT.
1890 [153]"CONTROLS:
1900 PRINT" <[146] FOR SINGLE STEP;
1910 [153]" RVSWAIT FOR SLOW STEP;
1920 PRINT" SPACE[146] FOR FAST STEPPING;
1930 [153]" STOPWAIT TO RETURN TO MONITOR."
1940 [153]"[ON BUSINESS KEYBOARDS--
1950 PRINT" USE 8[146],_[146],6[146] AND STOP[146]].
1990 [141]9000
2000 [153]" FILL MEMORY "
2010 [153]".FWAIT 1000WAIT 1100WAIT FF
2020 PRINT" FILLS THE MEMORY FROM 1000 HEX TO
2030 [153]"1100 HEX WITH THE BYTE FF HEX.
2090 GOSUB9000
2100 PRINT" GO RUN "
2110 PRINT".G
2120 [153]" GO TO THE ADDRESS IN THE PC
2130 PRINT"REGISTER DISPLAY AND BEGIN RUN CODE.
2140 [153]"ALL THE REGISTERS WILL BE REPLACED
2150 PRINT"WITH THE DISPLAYED VALUES."
2160 PRINT".G[146] 1000
2170 [153]" GO TO ADDRESS 1000 HEX AND BEGIN
2180 PRINT"RUNNING CODE.
2190 [141]9000
2200 [153]" HUNT MEMORY "
2210 [153]".HWAIT C000WAIT D000WAIT 'READ
2220 PRINT" HUNT THRU MEMORY FROM C000 HEX TO
2230 [153]"D000 HEX FOR THE ASCII STRING READWAIT AND
2240 PRINT"PRINT THE ADDRESS WHERE IT IS FOUND. A
2250 [153]"MAXIMUM OF 32 CHARACTERS MAY BE USED.
2260 PRINT".H[146] C000[146] D000[146] 20[146] D2[146] FF
2270 [153]" HUNT MEMORY FROM C000 HEX TO D000
2280 PRINT"HEX FOR THE SEQUENCE OF BYTES 20 D2 FF
2290 [153]"AND PRINT THE ADDRESS. A MAXIMUM OF 32
2300 PRINT"BYTES MAY BE USED.
2390 [141]9000
2400 [153]" LOAD "
2401 [153]".LWAIT
2402 PRINT" LOAD ANY PROGRAM FROM CASSETTE #1.
2403 [153]".LWAIT ";[199](34);"RAM TEST";[199](34)
2404 [153]" LOAD FROM CASSETTE #1 THE PROGRAM
2405 PRINT"NAMED RAM TEST[146].
2410 [153]".LWAIT ";[199](34);"RAM TEST";[199](34);",08WAIT
2420 PRINT" LOAD FROM DISK (DEVICE 8) THE PROGRAM
2430 [153]"NAMED RAM TESTWAIT.
2440 PRINT"THIS COMMAND LEAVES BASIC POINTERS
2450 [153]"UNCHANGED.
2490 GOSUB9000
2500 PRINT" MEMORY DISPLAY "
2510 PRINT".M[146] 0000[146] 0080
2520 [153]".: 0000 00 01 02 03 04 05 06 07
2530 PRINT".: 0008 08 09 0A 0B 0C 0D 0E 0F
2540 [153]" DISPLAY MEMORY FROM 0000 HEX TO
2550 PRINT"0080 HEX. THE BYTES FOLLOWING THE
2560 [153]"ADDRESS MAY BE MODIFIED BY EDITING AND
2570 PRINT"THEN TYPING A RETURN.
2590 [141]9000
2600 [153]" REGISTER DISPLAY "
2610 [153]".R
2620 PRINT" PC IRQ SR AC XR YR SP
2630 [153]".; 0000 E62E 01 02 03 04 05
2640 PRINT" DISPLAYS THE REGISTER VALUES SAVED
2650 [153]"WHEN SUPERMONWAIT WAS ENTERED. THE VALUES
2660 PRINT"MAY BE CHANGED WITH THE EDIT FOLLOWED
2670 [153]"BY A RETURN.
2671 PRINT" USE THIS INSTRUCTION TO SET UP THE
2672 [153]"PC VALUE BEFORE SINGLE STEPPING WITH"
2673 [153]".IWAIT
2690 GOSUB9000
2700 PRINT" SAVE"
2710 PRINT".S[146] ";CHR$(34);"PROGRAM NAME";CHR$(34);",01,0800,0C80"
2720 PRINT" SAVE TO CASSETTE #1 MEMORY FROM
2730 [153]"0800 HEX UP TO BUT NOT INCLUDING 0C80
2740 PRINT"HEX AND NAME IT PROGRAM NAME[146].
2750 [153]".SWAIT ";[199](34);"0:PROGRAM NAME";[199](34);",08,1200,1F50"
2760 [153]" SAVE TO DISK DRIVE #0 MEMORY FROM
2770 PRINT"1200 HEX UP TO BUT NOT INCLUDING 1F50
2780 [153]"HEX AND NAME IT PROGRAM NAMEWAIT.
2790 GOSUB9000
2800 PRINT" TRANSFER MEMORY "
2810 PRINT".T[146] 1000[146] 1100[146] 5000
2820 [153]" TRANSFER MEMORY IN THE RANGE 1000
2830 PRINT"HEX TO 1100 HEX AND START STORING IT AT
2840 [153]"ADDRESS 5000 HEX.
2890 GOSUB9000
3200 PRINT" EXIT TO BASIC "
3210 PRINT".X
3220 [153]" RETURN TO BASIC READY MODE.
3230 PRINT"THE STACK VALUE SAVED WHEN ENTERED WILL
3240 [153]"BE RESTORED. CARE SHOULD BE TAKEN THAT
3250 PRINT"THIS VALUE IS THE SAME AS WHEN THE
3260 [153]"MONITOR WAS ENTERED. A CLR IN
3270 PRINT"BASIC WILL FIX ANY STACK PROBLEMS.
3290 [141]9000
3500 [153]"ON SUMMARY "
3505 [153]"COMMODORE MONITOR INSTRUCTIONS:"
3510 [153]"GWAIT GO RUN
3520 PRINT"L[146] LOAD FROM TAPE OR DISK
3530 [153]"MWAIT MEMORY DISPLAY
3540 PRINT"R[146] REGISTER DISPLAY
3550 [153]"SWAIT SAVE TO TAPE OR DISK
3560 PRINT"X[146] EXIT TO BASIC
3595 [153]"SUPERMON ADDITIONAL INSTRUCTIONS:"
3600 [153]"AWAIT SIMPLE ASSEMBLER
3610 PRINT"D[146] DISASSEMBLER
3620 [153]"FWAIT FILL MEMORY
3630 PRINT"H[146] HUNT MEMORY
3640 [153]"IWAIT SINGLE INSTRUCTION
3650 PRINT"P[146] PRINTING DISASSEMBLER
3660 [153]"TWAIT TRANSFER MEMORY
4000 GOSUB9000
4010 PRINT"[145]SUPERMON[146] WILL LOAD ITSELF INTO THE
4020 [153]"TOP OF MEMORY .. WHEREVER THAT HAPPENS
4030 PRINT"TO BE ON YOUR MACHINE.
4040 [153]" YOU MAY THEN SAVE THE MACHINE CODE
4050 PRINT"FOR FASTER LOADING IN THE FUTURE.
4060 [153]"BE SURE TO NOTE THE SYS COMMAND WHICH
4070 PRINT"LINKS SUPERMON[146] TO THE COMMODORE
4080 [153]"MONITOR.
5000 END
9000 PRINT"PRESS ANY KEY TO CONTINUE.";
9005 GETA$:IFA$=""GOTO9005
9010 PRINT"[147]";
10040 RETURN